package com.dreampharos.util;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public class SessionUtil {

	public boolean SessionValue(HttpServletRequest request, String sessionName) {		
		boolean flag = false;
		
		HttpSession session = null;
		session = request.getSession();
		
		if(session != null && session.getAttribute(sessionName) != null) {
			flag = true;
		} else {
			flag = false;
		}
		
		return flag;
	}
	
	/*
	public String SessionValue(HttpServletRequest request, String sessionName, String name) {
		String returnVal = null;
		
		if(SessionValue(request, sessionName)) {
			HttpSession session = null;
			session = request.getSession();
			
			MemberInfoBean sessionBean = new MemberInfoBean();
			sessionBean = (MemberInfoBean)session.getAttribute(sessionName);
			
			if("user_id".equals(name)) {
				returnVal = sessionBean.getUser_id();
			} else if("user_name".equals(name)) {
				returnVal = sessionBean.getUser_name();
			} else if("team".equals(name)) {
				returnVal = sessionBean.getTeam();
			} else if("sub_team".equals(name)) {
				returnVal = sessionBean.getSub_team();
			}else if("team_duty".equals(name)) {
				returnVal = sessionBean.getTeam_duty();
			}else {
				returnVal = "";
			}
		} else {
			returnVal = "";
		}
		
		return returnVal;
	}
	*/
}
